package router

import (
	"car-trade-sys/handlers"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	//用户登录
	r.POST("user/login", handlers.Login)
	//关联角色权限
	r.POST("roleNode/add", handlers.Add)
	//用户角色的查询
	r.GET("userRole/list", handlers.UList)
	//角色查询权限
	r.GET("roleNode/list", handlers.RList)
	//车辆信息添加
	r.POST("car/add", handlers.CarAdd)
	//交易订单添加
	r.POST("order/add", handlers.OrderAdd)
	//订单查询
	r.GET("carOrderList", handlers.Find)
	//订单详情
	r.GET("carOrderDetail", handlers.Detail)
	return r

}
